package com.example.bookstorebackend.entity;



import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;
import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import java.util.*;

@Data
@Entity
@Table(name = "book")
@Proxy(lazy = false)
@JsonIgnoreProperties(value = {"handler","hibernateLazyInitializer","fieldHandler"})
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,property = "bookId")
public class Book {
    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy= GenerationType.IDENTITY )
    private Integer bookId;

    @Column(name = "isbn")
    private String ISBN;

    @Column(name = "name")
    private String bookName;

    @Column(name = "description")
    private String description;

    @Column(name = "type")
    private String bookType;

    @Column(name = "author")
    private String author;

    @Column(name = "price")
    private Integer price;

    @Column(name = "image")
    private String bookImage;

    @Column(name = "number")
    private Integer number;
}


